package com.lagou.demo.service.impl;


import com.lagou.demo.dao.ResumeDao;
import com.lagou.demo.pojo.Resume;
import com.lagou.demo.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class ResumeServiceImpl implements ResumeService {

    @Autowired
    private ResumeDao resumeDao;

    @Override
    public List<Resume> findAll() {
        return resumeDao.findAll();
    }

    @Override
    public Resume findById(Long id) {
        return resumeDao.findById(id).get();
    }

    @Override
    public void deleteById(Long id) {
        resumeDao.deleteById(id);
    }

    /**
     * 如果有id就是修改， 否则就是新增
     * @param resume 之后的对象
     * @return
     */
    @Override
    public Resume save(Resume resume) {
        return resumeDao.save(resume);
    }

    @Override
    public List<Resume> saveAll(Iterable<Resume> iterable) {
        return this.resumeDao.saveAll(iterable);
    }

}
